/**
 * This is an interface for loading an association lazily.
 * @author shahma
 */
dojo.provide("medryx.orm.PersistenceService");
dojo.require("medryx.AbstractBase");

dojo.declare("medryx.orm.PersistenceService", medryx.AbstractBase, {
	
		/**
		 * This maps to the ReadApi's fetch method
		 * 
		 * the deferred calls back with an object:
		 * {
		 *    total: total number of records available for this query, or -1 if unknown
		 *    items:array of items
		 * }
		 * returns a deferred (always)
		 * 
		 * @param {Object} kwArgs
		 */
		$fetch:null,
		
		/**
		 * returns a deferred (always) that callsback with 
		 * the id if successful
		 * 
		 * if no id is null or < 0, then this is a put, otherwise it is
		 * a post
		 * 
		 * entityClass, id, propertiesToPersist
		 */
		$save:null,
		
		/**
         * maps to WriteApi deleteItem
         * 
         * returns a deferred (always)
         * 
         * @param {Object} entityClass, id
         */
        $deleteItem:null,
		
		/**
		 * given an entiyClass, id, and properties, full load an instance 
		 * that guarantees that each property in properties is initialized
		 * (or if no properties are specified, then some contract
		 * between client and server about "default" loading has
		 * been fulfilled)
		 */
		$load:null
});
